package com.able.wanandroid.http;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/12/4.
 */

public class RetrofitFactory {

    private static OkHttpClient client;
    private static Retrofit retrofit;

//    private static final String HOST = "http://192.168.9.228:8087/express/api/";
    private static final String HOST = "http://www.wanandroid.com/";

    static {
        client = new OkHttpClient.Builder()
                .connectTimeout(10, TimeUnit.SECONDS)
                .build();

        retrofit = new Retrofit.Builder()
                .baseUrl(HOST)
                .client(client)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public static Retrofit getInstance() {
        return retrofit;
    }
}
